package entity

import (
	"time"
)

// Menu [...]
type Menu struct {
	ID         uint64    `gorm:"primaryKey;column:id" json:"-"`
	CreatedAt  time.Time `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt  time.Time `gorm:"column:updated_at" json:"updatedAt"`
	Name       string    `gorm:"column:name" json:"name"`
	Icon       string    `gorm:"column:icon" json:"icon"`
	Router     string    `gorm:"column:router" json:"router"`
	ParentID   uint64    `gorm:"column:parent_id" json:"parentId"`
	ParentPath string    `gorm:"column:parent_path" json:"parentPath"`
	IsShow     int8      `gorm:"column:is_show" json:"isShow"`
	Status     int8      `gorm:"column:status" json:"status"`
	Sequence   int64     `gorm:"column:sequence" json:"sequence"`
	Memo       string    `gorm:"column:memo" json:"memo"`
	Creator    uint64    `gorm:"column:creator" json:"creator"`
}

// TableName get sql table name.获取数据库表名
func (m *Menu) TableName() string {
	return "menu"
}

// MenuColumns get sql column name.获取数据库列名
var MenuColumns = struct {
	ID         string
	CreatedAt  string
	UpdatedAt  string
	Name       string
	Icon       string
	Router     string
	ParentID   string
	ParentPath string
	IsShow     string
	Status     string
	Sequence   string
	Memo       string
	Creator    string
}{
	ID:         "id",
	CreatedAt:  "created_at",
	UpdatedAt:  "updated_at",
	Name:       "name",
	Icon:       "icon",
	Router:     "router",
	ParentID:   "parent_id",
	ParentPath: "parent_path",
	IsShow:     "is_show",
	Status:     "status",
	Sequence:   "sequence",
	Memo:       "memo",
	Creator:    "creator",
}
